package com.ytt;

import java.util.Optional;
import java.util.function.Function;

public class xx {

    public static void main(String[] args){

        User2 user2;
        Optional<User2> optionalUser2=Optional.of(user2);
        String a="";
        optionalUser2.map(u -> {
            a="2";
            return u.getAge();
        });
    }

    public static void test(User2 user2){
        Optional<User2> optional=Optional.of(user2);


        String a="1";
        optional.orElse();
    }
}
class User2{
    String name;
    String age;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getAge() {
        return age;
    }

    public void setAge(String age) {
        this.age = age;
    }
}
